package com.cloudlead.web.resource;

import com.cloudlead.common.worker.web.WorkerInfo;
import com.cloudlead.common.worker.web.WorkerRegistry;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.Collection;

/**
 * Created by dean on 2015/7/24.
 */
@Path("/dashboard")
@Produces(MediaType.APPLICATION_JSON)
public class DashboardController {

    @GET
    public Collection<WorkerInfo> findWorkers(){
        Collection<WorkerInfo> workerList = WorkerRegistry.getInstance().getWorkerList().values();
        return workerList;
    }
}
